package com.sright.bcard.common.service.share.enums;

/**
 * 用户审核状态 审核状态 0：正常 1：有风险
 */
public enum UserCheckStatusEnum {

    NORMAL("正常" , 0),
    RISKS("有风险", 1),
    ;
    private String name;

    private Integer code;

    UserCheckStatusEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static UserCheckStatusEnum getEnum(String name) {
        try {
            return valueOf(name);
        } catch (Exception e) {
            return null;
        }
    }


    public static UserCheckStatusEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }

        for (UserCheckStatusEnum item : UserCheckStatusEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public Integer getValue() {
        return code;
    }

    public void setValue(Integer code) {
        this.code = code;
    }

}
